package com.xxx.ware.ware_manage_sys.bean.enums;

import java.util.HashMap;
import java.util.Map;

public enum SexEnum {
    MAN("1", "男"),
    WOMAN("2", "女");
    private String sexCode;
    private String sexText;
    private static Map<String, String> sexMap = new HashMap<>();

    static {
        SexEnum[] values = SexEnum.values();
        for (SexEnum value : values) {
            sexMap.put(value.sexCode, value.sexText);
        }
    }

    SexEnum(String sexCode, String sexText) {
        this.sexCode = sexCode;
        this.sexText = sexText;
    }

    public static String getSex(String code){
        return sexMap.get(code);
    }

}
